package com.gxh.controller.admin;

import com.gxh.dto.FavoritePageQueryDTO;
import com.gxh.result.PageResult;
import com.gxh.result.Result;
import com.gxh.service.FavoriteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("AdminFavoriteController")
@RequestMapping("/admin/favorite")
@Api(tags = "用户收藏管理")
@Slf4j
public class FavoriteController {

    @Autowired
    private FavoriteService favoriteService;

    /**
     * 用户收藏分页查询
     * @param favoritePageQueryDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation(value = "用户收藏分页查询")
    public Result<PageResult> page(FavoritePageQueryDTO favoritePageQueryDTO){
        log.info("用户收藏分页查询：{}", favoritePageQueryDTO);
        PageResult pageResult = favoriteService.pageQuery(favoritePageQueryDTO);
        return Result.success(pageResult);
    }
}
